<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        margin: 0;
        padding: 0;
        background-color: #ccc;
      }
      .background1 {
        position: absolute;
        bottom: 0;
        width: 100%;
        height: 386px;
        overflow: hidden;
        background: url(./img/bg1.png) repeat-x;
        animation: movebackground1 8s linear 0s infinite;
      }
      .background2 {
        position: absolute;
        bottom: 0%;
        width: 100%;
        height: 569px;
        overflow: hidden;
        background: url(./img/bg2.png) repeat-x;
        animation: movebackground1 8s linear 0s infinite;
      }
      .bear {
        position: absolute;
        bottom: -10%;
        width: 200px;
        height: 200px;
        background: url(./img/bear.png) no-repeat;
        animation: bear 0.5s steps(8) 0s infinite, move 3s forwards;
      }
      @keyframes bear {
        0% {
          background-position: 0 0;
        }
        100% {
          background-position: -1600px 0;
        }
      }
      @keyframes move {
        0% {
          left: 0;
        }
        100% {
          left: 50%;
          transform: translateX(-50%);
        }
      }
      @keyframes movebackground1 {
        0% {
          background-position: 0 100%;
        }
        100% {
          background-position: -3840px 100%;
        }
      }
    </style>
  </head>
  <body>
    <div class="background2">
      <div class="background1">
        <div class="bear"></div>
      </div>
    </div>
  </body>
</html>
